package com.changgou.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @Author : 残影
 * @Date: 2020/7/29 11:31
 */

public interface SpecMapper extends Mapper<Spec> {
    @Select("SELECT name,options " +
            "FROM tb_spec " +
            "WHERE template_id in(SELECT template_id " +
            "FROM tb_category " +
            "WHERE name=#{categoryName})")
    List<Map> findSpecListByCategoryName(@Param("categoryName") String categoryName);
}
